rescale
R = rescale(A, a=0.0, b=1.0; inputmin=nothing, inputmax=nothing, stretch=false, type=nothing)
A: is either a GMTgrid, GMTimage, Matrix{AbstractArray} or a file name. In later case the file is read with a call to gmtread that automatically decides how to read it based on the file extension ... not 100% safe.
rescale(A)rescales all entries of an arrayAto [0,1].
rescale(A,b,c)rescales all entries of A to the interval [b,c].
rescale(..., inputmin=imin)sets the lower boundiminfor the input range. Input values less thaniminwill be replaced withimin. The default is min(A).
rescale(..., inputmax=imax)sets the lower boundimaxfor the input range. Input values greater thanimaxwill be replaced withimax. The default is max(A).
rescale(..., stretch=true)automatically determines [inputmin inputmax] via a call to histogram that will (try to) find good limits for histogram stretching. The formstretch=(imin,imax)allows specifying the input limits directly.
type: Converts the scaled array to this data type. Valid options are all Unsigned types (e.g.UInt8). Default returns the same data type asAif it's an AbstractFloat, or Flot64 ifAis an integer.
Returns
A GMTgrid if A is a GMTgrid of floats, a GMTimage if A is a GMTimage and type is used or an array of Float32|64 otherwise.
See Also
imagescThese docs were autogenerated using GMT: v1.23.0